<script setup>
import {useRoute, useRouter} from "vue-router";

  const props = defineProps({
    linkTitle: {
      type: String,
      default: ''
    }
  })

  const router = useRouter()
  const route = useRoute()
  onMounted(() => {
    console.log(route,"route.name")
  })


const handleBack = () => {
    router.go(-1)
}
</script>

<template>
  <div class="backLink" @click="handleBack">
    <div class="backIcon">
      <el-icon><ArrowLeftBold /></el-icon>
    </div>
    <div class="title">{{linkTitle !== '' ? linkTitle : route.meta.title}}</div>
  </div>
</template>

<style scoped lang="scss">
  .backLink{
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 20px;
    .title{
      margin-left: 10px;
      font-weight: bold;
    }
  }
</style>
